<template>
  <div :class="$style.miniPanel">
    <div :class="$style.header" v-if="title">
      <span class="title">{{title}}</span>
      <slot class="ext" name="minipanelExt" />
    </div>
    <div :class="$style.miniBody" :style="{height}">
      <el-scrollbar style="height:100%;">
        <slot name="body" />
      </el-scrollbar>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: ""
    },
    height: {
      type: String,
      default: "500px"
    }
  }
};
</script>
<style module lang='scss'>
.miniPanel {
  background: #ffffff;
  box-shadow: 0 5px 10px 0 rgba(170, 177, 183, 0.1);
  border-radius: 4px;
  margin-bottom: 20px;
  background: #fff;
  border: 1px solid #e0e2e9;

  .header {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid #e0e2e9;
    background-color: #f7f8f9;
    height: 35px;

    :global {
      .title {
        height: 20px;
        font-size: 14px;
        font-family: PingFang SC;
        font-weight: 400;
        line-height: 20px;
        color: #333;
      }
      .ext {
        display: flex;
        align-items: center;
        :global(.el-range-separator) {
          padding: 0;
        }
        :global(.el-range__icon) {
          font-size: 14px !important;
        }
      }
    }
  }
  :global {
    .el-scrollbar__wrap {
      overflow-x: hidden;
    }
  }
}
.miniBody {
//   padding: 16px 0;
    height: calc(100% - 35px);
}
</style>
